package cn.edu.jmu.oelp.service.impl;

import cn.edu.jmu.oelp.mapper.UserMapper;
import cn.edu.jmu.oelp.service.UserService;
import cn.edu.jmu.oelp.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author huanghongbe
 */

@Service
@Transactional(rollbackFor=Exception.class)
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User userLogin(User user) {
        return userMapper.userLogin(user);
    }

    @Override
    public boolean addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public boolean delUser(int id) {
        return userMapper.delUser(id);
    }

    @Override
    public List<User> selUserByUserName(String username) {
        return userMapper.selUserByUserName(username);
    }

    @Override
    public User selUserByAccount(String account) {
        return userMapper.selUserByAccount(account);
    }

    @Override
    public User selUserById(int id) {
        return userMapper.selUserById(id);
    }

    @Override
    public boolean updateUser(User user) {
        return userMapper.updateUser(user);
    }
}
